#pragma once
#include <iostream>
#include <string>
using namespace std;
struct Character {
    template <typename T>
    friend class binaryTree;
    char ch;
    int weight;
    string code;
    Character() {
        ch = '0';
        weight = 0;
        code = "";
    };
    Character& operator=(Character& value)
    {
        ch = value.ch;
        weight = value.weight;
        code = value.code;
        return *this;
    }
    Character& operator=(int value) {
        weight = value;
        return *this;
    }
    Character operator+(Character& a)
    {
        Character temp;
        temp.ch = 0;
        temp.weight = this->weight + a.weight;
        return temp;
    }
    bool operator<=(Character& a) {
        if (this->weight <= a.weight)
            return true;
        else
            return false;
    }
    bool operator<(Character& a) {
        if (this->weight < a.weight)
            return true;
        else
            return false;
    }
    bool operator>(Character& a) {
        if (this->weight > a.weight)
            return true;
        else
            return false;
    }
    friend ostream& operator<<(ostream& out, Character& b);
};
ostream& operator<<(ostream& out, Character& b) {
    out << "ch = " << b.ch << "weight = " << b.weight << "code = " << b.code;
    return out;
}